class MyArray <T>{
    public Object[] array = new Object[5];
    public void set(int pos,T val){
        array[pos] = val;

    }
    public T getValue(int pos){
        return (T)array[pos];
    }


}

public class Test2 {
    public static void main(String[] args) {
        MyArray<Integer> myArray = new MyArray<Integer>();
        myArray.set(0,12);
        myArray.set(1,66);
        Integer integer1 = myArray.getValue(0);
        Integer integer = myArray.getValue(1);
        System.out.println(integer1);
        System.out.println(integer);


        MyArray<String> myArray2 = new MyArray<String>();
        myArray2.set(2,"hello");
        String str = myArray2.getValue(2);
        System.out.println(str);
    }
    public static void main1(String[] args) {
        MyArray myArray = new MyArray();
        myArray.set(0,12);
        myArray.set(1,"world");
        String str = (String) myArray.getValue(1);
    }
}